Properties

$nowrite

$nowrite : bool

Blocks session data from being written to database.

Can be used if write-race conditions are to be expected

Type

bool

$config

$config

$key

$key

$ip

$ip

$cookie

$cookie

$changed

$changed

$start

$start

$vars

$vars

$now

$now

$lifetime

$lifetime

$time_diff

$time_diff

$reloaded

$reloaded

$appends

$appends

$unsets

$unsets

$gc_enabled

$gc_enabled

$gc_handlers

$gc_handlers

$cookiename

$cookiename

$ip_check

$ip_check

$logging

$logging

$ignore_write

$ignore_write

$memcache

$memcache : \Memcached

Type

\Memcached — The memcache driver

$debug

$debug : bool

Type

bool — Debug state

Methods

factory()

factory(\rcube_config  $config) : \rcube_session

Factory, returns driver-specific instance of the class

Parameters

\rcube_config $config

Returns

\rcube_session —

Session object

__construct()

__construct(\rcube_config  $config) : mixed

Object constructor

Parameters

\rcube_config $config

Configuration

Returns

mixed —

register_session_handler()

register_session_handler() : mixed

Register session handler

Returns

mixed —

start()

start() : mixed

Wrapper for session_start()

Returns

mixed —

open()

open(string  $save_path, string  $session_name) : bool

Opens the session

Parameters

string $save_path

Session save path

string $session_name

Session name

Returns

bool —

True on success, False on failure

close()

close() : bool

Close the session

Returns

bool —

True on success, False on failure

destroy()

destroy(string  $key) : bool

Destroy the session

Parameters

string $key

Session identifier

Returns

bool —

True on success, False on failure

read()

read(string  $key) : string

Read session data from memcache

Parameters

string $key

Session identifier

Returns

string —

Serialized data string

write()

write(string  $key, string  $vars) : bool

Write data to memcache storage

Parameters

string $key

Session identifier

string $vars

Session data string

Returns

bool —

True on success, False on failure

update()

update(string  $key, string  $newvars, string  $oldvars) : bool

Update memcache session data

Parameters

string $key

Session identifier

string $newvars

New session data string

string $oldvars

Old session data string

Returns

bool —

True on success, False on failure

sess_write()

sess_write(string  $key, string  $vars) : bool

Session write handler. This calls the implementation methods for write/update after some initial checks.

Parameters

string $key

Session identifier

string $vars

Serialized data string

Returns

bool —

True on success, False on failure

write_close()

write_close() : mixed

Wrapper for session_write_close()

Returns

mixed —

create()

create(array  $data) : string

Creates a new (separate) session

Parameters

array $data

Session data

Returns

string —

Session identifier (on success)

gc()

gc(int  $maxlifetime) : bool

Execute registered garbage collector routines

Parameters

int $maxlifetime

Maximum session lifetime

Returns

bool —

True on success, False on failure

register_gc_handler()

register_gc_handler(mixed  $func) : mixed

Register additional garbage collector functions

Parameters

mixed $func

Returns

mixed —

regenerate_id()

regenerate_id(bool  $destroy = true) : bool

Generate and set new session id

Parameters

bool $destroy

If enabled the current session will be destroyed

Returns

bool —

True on success, False on failure

append()

append(string  $path, string  $key, mixed  $value) : mixed

Append the given value to the certain node in the session data array

Warning: Do not use if you already modified $_SESSION in the same request (#1490608)

Parameters

string $path

Path denoting the session variable where to append the value

string $key

Key name under which to append the new value (use null for appending to an indexed list)

mixed $value

Value to append to the session data array

Returns

mixed —

remove()

remove(string  $var = null) : bool

Unset a session variable

Parameters

string $var

Variable name (can be a path denoting a certain node in the session array, e.g. compose.attachments.5)

Returns

bool —

True on success, False on failure

kill()

kill() : mixed

Kill this session

Returns

mixed —

reload()

reload() : mixed

Re-read session data from storage backend

Returns

mixed —

unserialize()

unserialize(string  $str) : array

Unserialize session data http://www.php.net/manual/en/function.session-decode.php#56106

Parameters

string $str

Serialized data string

Returns

array —

Unserialized data

set_lifetime()

set_lifetime(int  $lifetime) : mixed

Setter for session lifetime

Parameters

int $lifetime

Session lifetime (in seconds)

Returns

mixed —

get_ip()

get_ip() : string

Getter for remote IP saved with this session

Returns

string —

Client IP address

set_secret()

set_secret(string  $secret = null) : mixed

Setter for cookie encryption secret

Parameters

string $secret

Authentication secret string

Returns

mixed —

set_ip_check()

set_ip_check(bool  $check) : mixed

Enable/disable IP check

Parameters

bool $check

IP address checking state

Returns

mixed —

set_cookiename()

set_cookiename(string  $name) : mixed

Setter for the cookie name used for session cookie

Parameters

string $name

Authentication cookie name

Returns

mixed —

check_auth()

check_auth() : bool

Check session authentication cookie

Returns

bool —

True if valid, False if not

set_auth_cookie()

set_auth_cookie() : mixed

Set session authentication cookie

Returns

mixed —

log()

log(mixed  $line) : mixed

Writes debug information to the log

Parameters

mixed $line

Returns

mixed —

_fixvars()

_fixvars(mixed  $vars, mixed  $oldvars) : mixed

Merge vars with old vars and apply unsets

Parameters

mixed $vars
mixed $oldvars

Returns

mixed —

gc_shutdown()

gc_shutdown() : mixed

Garbage collector handler to run on script shutdown

Returns

mixed —

get_cache()

get_cache(string  $key) : string

See if we have vars of this key already cached, and if so, return them.

Parameters

string $key

Session identifier

Returns

string —

Serialized data string

get_node()

get_node(mixed  $path, mixed  $data_arr) : mixed

Returns a reference to the node in data array referenced by the given path.

e.g. ['compose','attachments'] will return $_SESSION['compose']['attachments']

Parameters

mixed $path
mixed $data_arr

Returns

mixed —

serialize()

serialize(mixed  $vars) : mixed

Serialize session data

Parameters

mixed $vars

Returns

mixed —

_mkcookie()

_mkcookie(int  $timeslot) : string

Create session cookie for specified time slot.

Parameters

int $timeslot

Time slot to use

Returns

string —

Cookie value

debug()

debug(string  $type, string  $key, string  $data = null, bool  $result = null) : mixed

Write memcache debug info to the log

Parameters

string $type

Operation type

string $key

Session identifier

string $data

Data to log

bool $result

Operation result

Returns

mixed —